import http from "@/api";
import { ResPage } from "@/api/interface";
import {
  CreateProjectRecordParam,
  EditProjectRecordInfoParam,
  EditProjectRecordStatusParam,
  HxCustomerProjectRecord,
  QueryProjectAllRecordParam
} from "@/api/interface/projectRecord";

const apiName = "CustomerProjectRecord";

export const queryProjectAllRecord = (param: QueryProjectAllRecordParam) => {
  return http.post<ResPage<HxCustomerProjectRecord>>(`${apiName}/QueryProjectAllRecord`, param);
};

export const getProjectList = () => {
  return http.post<HxCustomerProjectRecord[]>(`${apiName}/GetProjectList`);
};

export const createProjectRecord = (param: CreateProjectRecordParam) => {
  return http.post<string>(`${apiName}/CreateProjectRecord`, param);
};

/** 修改客户项目信息 */
export const editProjectREcordInfo = (param: EditProjectRecordInfoParam) => {
  return http.post<string>(`${apiName}/EditProjectRecordInfo`, param);
};

/** 修改客户项目状态 */
export const editProjectRecordStatus = (param: EditProjectRecordStatusParam) => {
  return http.post<string>(`${apiName}/EditProjectRecordStatus`, param);
};
